use std::sync::mpsc::Sender;

use QcCore::scene_system::scene::Scene;
use QcUI::component::Canvas;

use crate::core::message::EditorMessage;

pub struct InspectorContext<'a> {
    pub ui: &'a mut egui::Ui,
    pub sender: &'a Sender<EditorMessage>,
    pub canvas_ptr: *mut Canvas,
    pub scene_ptr: *mut Scene,
}

impl<'a> InspectorContext<'a> {
    pub fn new(ui: &'a mut egui::Ui, sender: &'a Sender<EditorMessage>) -> Self {
        Self {
            ui,
            sender,
            canvas_ptr: std::ptr::null_mut(),
            scene_ptr: std::ptr::null_mut(),
        }
    }

    pub fn with_canvas_ptr(mut self, canvas_ptr: *mut Canvas) -> Self {
        self.canvas_ptr = canvas_ptr;
        self
    }

    pub fn with_scene_ptr(mut self, scene_ptr: *mut Scene) -> Self {
        self.scene_ptr = scene_ptr;
        self
    }
}
